<%--
  document: create-simple-product.jsp
  
  description:
    This form create a new simple product.
 --%>

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%-- Tag libs --%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="core"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="html"%>

<%@include file="jspf/head.jspf" %>


<h1>Créer un produit simple</h1>

<core:view>
  
  <html:messages layout="table" style="color: red" showDetail="false" showSummary="true" />
  
  <html:form>
    <html:panelGrid columns="2">
      
      <%-- Name --%>
      <html:outputText  value="Nom : " />
      <html:inputText   value="#{CreateSimpleProductControler.name}" required="#{true}">
        <core:attribute name="error-message" value="Un nom est neccéssaire" />
      </html:inputText>
      
      <%-- Description --%>
      <html:outputText  value="Description : " />
      <html:inputText   value="#{CreateSimpleProductControler.description}" required="#{true}">
        <core:attribute name="error-message" value="Une description est neccéssaire" />
      </html:inputText>
      
      <%-- Picture --%>
      <html:outputText  value="Image : " />
      <html:inputText   value="#{CreateSimpleProductControler.picture}" required="#{true}">
        <core:attribute name="error-message" value="Une image est neccéssaire" />
      </html:inputText>
      
      <html:commandButton value="Enregistrer"
                          action="#{CreateSimpleProductControler.create}" />
      
    </html:panelGrid>
  </html:form>
  
</core:view>

<%@include file="jspf/foot.jspf" %>
